<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <title> 客服系统</title>
    <meta name="keywords" content="客服系统">
    <meta name="description" content="客服系统">
    <link rel="stylesheet" type="text/css" href="/Public/css/normalize.css">
    <link rel="stylesheet" type="text/css" href="/Public/css/login.css">
    <!--<link rel="shortcut icon" href="/Public/admin/favicon.ico">-->
    <link href="/Public/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/admin/css/animate.css" rel="stylesheet">
    <link rel="stylesheet" href="css/normalize.css">
</head>
<body>
<div class="loginBg"></div>
<div class="loginBox">
    <!--<img src="/Public/image/login_logo.png"/>-->
    <div class="loginformBox">
        <img src="/Public/image/login_headbg.jpg"/>
        <div class="login_form">

            <form action="<{$SERVER_NAME}>/Index/index.html" onsubmit="return false">
                <span><em>用户名</em><input type="text" name="name" id="name"></span>
                <span><em>密　码</em><input type="password" name="pwd" id="pwd"></span>
                <input type="submit" name="login" id="login" class="login_btn" value="登录">
            </form>
        </div>
    </div>
</div>

<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/plugins/layer/layer.min.js"></script>
<script>

//    		function login() {
//
//                var phone = $('#name').val();
//                var pwd = $('#pwd').val();
//                var tourl = "<{$SERVER_NAME}>/Index/index";
//                console.log('1111111',tourl);
//                $.post('<{$SERVER_NAME}>/Login/get_login', {phone: phone, pwd: pwd}, function (data) {
//                    console.log('1111111',data);
//                    if (data.code == '1001') {
//                        window.location.href = tourl;
//                    } else {
//                        layer.msg(data.result, {time: 2000, icon: 5});
//                    }
//                });
//            }

    $('#login').on('click', function () {
        var phone = $('#name').val();
        var pwd = $('#pwd').val();
        var tourl = "<{$SERVER_NAME}>/Index/index";
//        var tourl = "<{$SERVER_NAME}>/Login/get_login"; {phone: phone, pwd: pwd}
        console.log('1111111',tourl);
        var  url="http://116.62.146.43/haoxin/shopKeeperlogin";
        $.post("<{$SERVER_NAME}>/Login/get_login", {phone: phone, pwd: pwd}, function (data) {
            console.log('23232',data);
            if (data.code == '1001') {
                window.location.href = tourl;
            } else {
                layer.msg(data.result, {time: 2000, icon: 5});
            }
        });
    })

    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 27) { // 按 Esc
            //要做的事情
        }
        if (e && e.keyCode == 113) { // 按 F2
            //要做的事情
        }
        if (e && e.keyCode == 13) { // enter 键
            $('#login').click();
            //要做的事情
        }
    };
</script>
</body>
</html>